clear all;

load estrp.mat

T = estrp( estrp(:,4)==1,:);
C = estrp( estrp(:,4)==0,:);

"Revenue"
variable = estrp(:,5).*estrp(:,11); %number of searches * revenue per search
variableT = T(:,5).*T(:,11); 
variableC = C(:,5).*C(:,11);

[1 mean(variableT)/mean(variable) mean(variableC)/mean(variable)]

[std(variable)/mean(variable) std(variableT)/mean(variable) std(variableC)/mean(variable)]

diff = (mean(variableT) - mean(variableC))/mean(variable)
[~,p,~,stats] = ttest2(variableT,variableC,'Vartype','unequal')

"Revenue per search"
variable = estrp(:,11); 
variableT = T(:,11); 
variableC = C(:,11);

[1 mean(variableT)/mean(variable) mean(variableC)/mean(variable)]

[std(variable)/mean(variable) std(variableT)/mean(variable) std(variableC)/mean(variable)]

diff = (mean(variableT) - mean(variableC))/mean(variable)
[~,p,~,stats] = ttest2(variableT,variableC,'Vartype','unequal')


"Number of searches"
variable = estrp(:,5); 
variableT = T(:,5); 
variableC = C(:,5);

[mean(variable) mean(variableT) mean(variableC)]

[std(variable) std(variableT) std(variableC)]

diff = mean(variableT) - mean(variableC)
[~,p,~,stats] = ttest2(variableT,variableC,'Vartype','unequal')


"Depth"
variable = estrp(:,8); 
variableT = T(:,8); 
variableC = C(:,8);

[mean(variable) mean(variableT) mean(variableC)]

[std(variable) std(variableT) std(variableC)]

diff = mean(variableT) - mean(variableC)
[~,p,~,stats] = ttest2(variableT,variableC,'Vartype','unequal')

"Estimated optimal reserve price"
variable = estrp(:,12); 
variableT = T(:,12); 
variableC = C(:,12);

[mean(variable) mean(variableT) mean(variableC)]

[std(variable) std(variableT) std(variableC)]

diff = mean(variableT) - mean(variableC)
[~,p,~,stats] = ttest2(variableT,variableC,'Vartype','unequal')

"Sample size"
[size(estrp,1) size(T,1) size(C,1)]
